import { BigNumber, Complex, Fraction, MathArray, Matrix, round as base_round } from 'mathjs';

/**
 * 四舍五入
 * @param val 数值
 * @param n 可选参数，精确到小数点后几位
 */
export default function round(val: number, n = 0) {
	return base_round(val, n) as number | BigNumber | Fraction | Complex | MathArray | Matrix;
}
